package com.erp.module.ProjectOrderProcess

import android.content.Context
import android.util.Log
import com.erp.Interface.OnUserDataInterface
import com.erp.bean.ProjectOrderProcessBean
import com.erp.contacts.Contacts
import com.erp.util.Httputil
import org.xutils.http.RequestParams
import org.xutils.x

class ProjectOrderProcessM : ProjectOrderProcessContract.ProjectOrderProcessMP{
    override fun putProjectOrderProcess(context: Context, mlist: MutableList<ProjectOrderProcessBean>, onUserDataInterface: OnUserDataInterface) {
        val params = RequestParams(Contacts.PROJECT_ORDER_PROCES)
        Httputil.getparams(context, params)
        Httputil.addtoken(params)
        for (i in 0 until mlist.size){
            params.addBodyParameter("Process["+i+"][scan_string]", mlist[i].scrn_string, Contacts.BOUNDARY)
            params.addBodyParameter("Process["+i+"][process]", mlist[i].process, Contacts.BOUNDARY)
        }
        Log.d("onSuccess",mlist.toString());
        x.http().post(params, Httputil.Call(context, onUserDataInterface))
    }
}